<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link rel="stylesheet" type="text/css" href="/plan/css/liucheng.css"/>
		<script type="text/javascript" src="/plan/js/jquery.1.9.1.js" ></script>
		<script type="text/javascript" src="/plan/js/rem.js" ></script>
                <script type="text/javascript" src="/plan/js/layer.js" ></script>
		<title>查看计划</title>
	</head>
	<style>
    </style>
	<body>
		<form id="liucheng" action="" method="post">
		<ul class="order_money">
			<p class="titie">
				<span style="margin-top: 0;">{$plan_info->department_text}的开会计划</span>
				<span class="{$plan_info->status_tu_text}">{$plan_info->status_text}</span>
				
			</p>
		    <li>
		    		<span class="meeting">开会周次</span>第{$plan_info->week_text}周 {$plan_info->start_time}~{$plan_info->end_time}
		    </li>
		    <li>
                                <span class="meeting">开会场次</span>{$plan_info->season}场
                    </li>  
                    <li>
		    		<span class="meeting">开会场地</span>{$plan_info->address}
		    </li>
		    <li>
		        <span class="meeting">备注</span>
		        <span class="meetinfo">{$plan_info->desc}</span>
		    </li>
		</ul>
                <ul class="list_info">
        		<p class="liucheng_title">审批流程</p>
                     {volist name="$plan_info.log" id="vo"}
        		<li>
                                {if $vo.type == 1}
        			<img class="tx" src="/plan/img/tongguo.jpg"/>
                                {else}
                                        <img class="tx" src="/plan/img/bohui.jpg"/>
                                {/if}
        			<p class="question">
        				<img src="{$vo.avatar_text}"/>
        				<span>{$vo.username}·{$vo.action}</span>
        				<span class="date">{:date('m/d  H:i',$vo['createtime'])}</span>
        			</p>
        			<p class="infodate">
        				“{$vo.content}”
        			</p>
        		</li>
                      {/volist}
        		<li>
        			<img class="tx" src="/plan/img/ing.jpg"/>
        			<p class="question">
        				<img src="<?php echo $admin->thumb_avatar?:$admin->thumb_avatar;?>"/>
        				<span>{$admin->username}•审批中</span>
        				<span class="date"></span>
        			</p>
        			<p class="infodate">
        				
        			</p>
        		</li>
        		
        </ul>
        <div class="sug">
        		<p class="titie">审批意见</p>
        		<textarea  id="content" name="content"></textarea>
        </div>
        
        <div class="button">
                <input id="status" name="row[status]" value="{$plan_info->status}" type="hidden">
        <input id="id"  value="{$plan_info->id}" type="hidden">
        		<div class="close" onclick="tj(-1)">驳回</div>
        		<div class="continue"><input class="pay" type="button" value="同意" onclick="tj(2)" /></div>
        </div>
     <!--    <div class="button">
        		<div class="again"><input class="pay" type="submit" value="重新提交"/></div>
        </div> -->
 </form>
</body>
<script>
 //同意 驳回
function tj(val) {
       
        //console.log(val);
        $('#submit_to_save').val(val);
          if(val == '-1'){
                if($('#content').val() == ''){
                    layer.open({
                                content:'请填写驳回理由' ,
                                skin: 'msg',
                                time: 2 //2秒后自动关闭
                        });
                  return false;
                }
          }
        var ids = $('#id').val();
        var content = $('#content').val()
        layer.open({type: 2});
        $.ajax({
          type: 'post',
          url:"/index/plan/do_check_save/ids/"+ids,
          data:{content:content,status:val},
          dataType: "json",
          success: function(data){
                console.log(data);
                if(data.code){
                         layer.open({
                                content:'操作成功' ,
                                skin: 'msg',
                                time: 2 //2秒后自动关闭
                        });
                         setTimeout(function () {
                                window.location.href = "/index/plan/lists";
                        },2000);
                }else{
                          layer.open({
                                content:data.msg ,
                                skin: 'msg',
                                time: 2 //2秒后自动关闭
                        });
                        setTimeout(function () {
                                window.location.href = "/index/plan/lists";
                        },2000);
                }
          
            //window.location.href = "";
           }
        });
  //$('#add-form').submit();
}

          
</script>
</html>
